﻿using System;
using hr_1.Model;

namespace hr_1.ViewModel
{
    public class EducationMilitaryViewModel : ViewModelBase
    {
        #region Fields

        readonly EducationMilitary _educationMilitary = new EducationMilitary();

        #endregion // Fields

        #region Constructor

        public EducationMilitaryViewModel() { }

        public EducationMilitaryViewModel(EducationMilitary educationMilitary)
        {
            if (educationMilitary == null)
                throw new ArgumentNullException("educationMilitary");

            _educationMilitary = educationMilitary;
        }

        #endregion // Constructor

        #region educationMilitary Properties

        public int PersonId
        {
            get { return _educationMilitary.PersonId; }
            set { _educationMilitary.PersonId = value; }
        }

        public string EdLevel
        {
            get { return _educationMilitary.EdLevel; }
            set
            {
                if (value == _educationMilitary.EdLevel)
                    return;
                _educationMilitary.EdLevel = value;
                base.OnPropertyChanged("EdLevel");
            }
        }

        public string Institution
        {
            get { return _educationMilitary.Institution; }
            set
            {
                if (value == _educationMilitary.Institution)
                    return;
                _educationMilitary.Institution = value;
                base.OnPropertyChanged("Institution");
            }
        }

        public string Faculty
        {
            get { return _educationMilitary.Faculty; }
            set
            {
                if (value == _educationMilitary.Faculty)
                    return;
                _educationMilitary.Faculty = value;
                base.OnPropertyChanged("Faculty");
            }
        }

        public string Speciality
        {
            get { return _educationMilitary.Speciality; }
            set
            {
                if (value == _educationMilitary.Speciality)
                    return;
                _educationMilitary.Speciality = value;
                base.OnPropertyChanged("Speciality");
            }
        }

        public string Qualification
        {
            get { return _educationMilitary.Qualification; }
            set
            {
                if (value == _educationMilitary.Qualification)
                    return;
                _educationMilitary.Qualification = value;
                base.OnPropertyChanged("Qualification");
            }
        }

        public string Degree
        {
            get { return _educationMilitary.Degree; }
            set
            {
                if (value == _educationMilitary.Degree)
                    return;
                _educationMilitary.Degree = value;
                base.OnPropertyChanged("Degree");
            }
        }
        public string DateEnd
        {
            get { return _educationMilitary.DateEnd; }
            set
            {
                if (value == _educationMilitary.DateEnd)
                    return;
                _educationMilitary.DateEnd = value;
                base.OnPropertyChanged("DateEnd");
            }
        }
        public string Diplom
        {
            get { return _educationMilitary.Diplom; }
            set
            {
                if (value == _educationMilitary.Diplom)
                    return;
                _educationMilitary.Diplom = value;
                base.OnPropertyChanged("Diplom");
            }
        }
        public string Status
        {
            get { return _educationMilitary.Status; }
            set
            {
                if (value == _educationMilitary.Status)
                    return;
                _educationMilitary.Status = value;
                base.OnPropertyChanged("Status");
            }
        }
        #endregion // educationMilitary Properties

        public void Save()
        {
            _educationMilitary.Save();
        }
    }
}
